<template>
  <div>
    <headDiv :seller="seller"> </headDiv>
    <ul class="underline">
      <li class="flex">
        <div class="tab cell-main">
          <router-link to="/goods">商品&nbsp;</router-link>
        </div>
        <div class="tab cell-main">
          <router-link to="/ratings">评论&nbsp;</router-link>
        </div>
        <div class="tab cell-main">
          <router-link to="/seller">商家&nbsp;</router-link>
        </div>
      </li>
    </ul>
        <router-view :seller="seller" keep-alive></router-view>
  </div>
</template>
<script>
const ERR_OK = 0;
import headDiv from './components/head/head.vue';
export default {
  name: 'app',
  data() {
    return {
      seller: {}
    }
  },
  created() {
    this.$http.get('./api/seller').then((response) => {
      if (response.data.errno === ERR_OK) {
        this.seller = response.data.data;
      }
    })
  },
  
  components: {
    headDiv
  }
}

</script>
<style>
.tab{text-align: center;line-height: 1.8rem; font-size: 16px;}
.tab .active{color: red;}
</style>
